using System;
using System.Windows.Forms;

namespace ctsu.Admin.Forms
{
	public class FormSearch : ctsu.BaseForms.FormSearchBase, IMessageFilter
	{
		const int WM_KEYDOWN = 0x100;
		const int WM_KEYUP = 0x101;

		private System.ComponentModel.IContainer components = null;

		public FormSearch()
		{
			// This call is required by the Windows Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose(disposing);
		}



		#region Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.SuspendLayout();
			// 
			// SearchResults
			// 
			this.SearchResults.Name = "SearchResults";
			this.SearchResults.Size = new System.Drawing.Size(480, 240);
			// 
			// SearchFields
			// 
			this.SearchFields.Location = new System.Drawing.Point(96, 9);
			this.SearchFields.Name = "SearchFields";
			this.SearchFields.Size = new System.Drawing.Size(182, 24);
			// 
			// Criteria
			// 
			this.Criteria.Location = new System.Drawing.Point(96, 74);
			this.Criteria.Name = "Criteria";
			this.Criteria.Size = new System.Drawing.Size(182, 22);
			// 
			// btnOK
			// 
			this.btnOK.Location = new System.Drawing.Point(86, 360);
			this.btnOK.Name = "btnOK";
			this.btnOK.Size = new System.Drawing.Size(96, 26);
			// 
			// btnCancel
			// 
			this.btnCancel.Location = new System.Drawing.Point(202, 360);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(96, 26);
			// 
			// Ascending
			// 
			this.Ascending.Location = new System.Drawing.Point(346, 9);
			this.Ascending.Name = "Ascending";
			this.Ascending.Size = new System.Drawing.Size(105, 22);
			// 
			// Descending
			// 
			this.Descending.Location = new System.Drawing.Point(346, 37);
			this.Descending.Name = "Descending";
			this.Descending.Size = new System.Drawing.Size(124, 22);
			// 
			// lblOrder
			// 
			this.lblOrder.Location = new System.Drawing.Point(288, 9);
			this.lblOrder.Name = "lblOrder";
			this.lblOrder.Size = new System.Drawing.Size(58, 37);
			// 
			// btnApply
			// 
			this.btnApply.Location = new System.Drawing.Point(317, 360);
			this.btnApply.Name = "btnApply";
			this.btnApply.Size = new System.Drawing.Size(96, 26);
			// 
			// FormSearch
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
			this.ClientSize = new System.Drawing.Size(499, 390);
			this.KeyPreview = false;
			this.Name = "FormSearch";
			this.Load += new System.EventHandler(this.FormSearch_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void FormSearch_Load(object sender, System.EventArgs e)
		{
			Application.AddMessageFilter(this);
		}

		#region IMessageFilter Members

		public bool PreFilterMessage(ref Message m)
		{
			if (m.Msg == WM_KEYDOWN)
			{
				Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode;
				Console.WriteLine("WndProc: " + keyCode.ToString());
			}
			return false;
		}

		#endregion

	}
}

